﻿CREATE TABLE [dbo].[ByggnadHandelseLogg] (
    [Id]          UNIQUEIDENTIFIER NOT NULL,
    [ValId]       UNIQUEIDENTIFIER NOT NULL,
    [Skapad]      DATETIME         NOT NULL,
    [SkapadAv]    NVARCHAR (50)    NOT NULL,
    [Andrad]      DATETIME         NULL,
    [AndradAv]    NVARCHAR (50)    NULL,
    [AtgardKravs] BIT              NOT NULL,
    [Text]        TEXT             NOT NULL,
    [ByggnadId]   UNIQUEIDENTIFIER NOT NULL,
    [Datum]       DATETIME         NOT NULL,
    CONSTRAINT [PK_ByggnadHandelseLogg] PRIMARY KEY CLUSTERED ([Id] ASC, [ValId] ASC),
    CONSTRAINT [FK_ByggnadHandelseLogg_Byggnad] FOREIGN KEY ([ByggnadId], [ValId]) REFERENCES [dbo].[Byggnad] ([Id], [ValId])
);



